package com.lanchetech.dao;

import com.lanchetech.bean.request.PageReq;
import com.lanchetech.bean.request.TimeTypeReq;
import com.lanchetech.bean.vo.BalanceFlowCountAndMoneyVO;
import com.lanchetech.bean.vo.BalanceFlowStatisticsVO;
import com.lanchetech.bean.vo.CountVO;
import com.lanchetech.entity.BalanceFlow;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface BalanceFlowMapper {
    int deleteByPrimaryKey(Long id);

    int insert(BalanceFlow record);

    int insertSelective(BalanceFlow record);

    BalanceFlow selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(BalanceFlow record);

    int updateByPrimaryKey(BalanceFlow record);

    int updateBatch(List<BalanceFlow> list);

    int updateBatchSelective(List<BalanceFlow> list);

    int batchInsert(@Param("list") List<BalanceFlow> list);

    List<BalanceFlow> findAllPage(PageReq req);

    CountVO getInAndOut(PageReq req);

    List<BalanceFlowStatisticsVO> getBalanceFlowStatistics(@Param("id") Long id, @Param("type") Byte type, @Param("date") Date date);

    BalanceFlowCountAndMoneyVO getBalanceFlowCountAndMoney(TimeTypeReq req);

    BigDecimal sumByUserIdAndTradeType(@Param("userId") Long userId, @Param("tradeType") Byte tradeType);
}